Merged
Conversation
tjzel
approved these changes
Nov 21, 2024
Collaborator
tjzel
left a comment
There was a problem hiding this comment.
Looks good to me overall. Make sure to test it with the newest Gesture Handler and SVG on their more complex examples, since they used to have cases where these refs mechanisms broke.
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Outdated
Show resolved
Hide resolved
tjzel
requested changes
Nov 22, 2024
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/commonTypes.ts
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
tomekzaw
reviewed
Nov 22, 2024
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Show resolved
Hide resolved
packages/react-native-reanimated/src/createAnimatedComponent/createAnimatedComponent.tsx
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
tjzel
reviewed
Nov 25, 2024
packages/react-native-reanimated/src/createAnimatedComponent/NativeEventsManager.ts
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
tjzel
approved these changes
Dec 3, 2024
packages/react-native-reanimated/src/platform-specific/findHostInstance.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/findHostInstance.ts
Outdated
Show resolved
Hide resolved
packages/react-native-reanimated/src/platform-specific/RNRenderer.ts
Outdated
Show resolved
Hide resolved
tomekzaw
approved these changes
Dec 4, 2024
piaskowyk
added a commit
that referenced
this pull request
Dec 10, 2024
piaskowyk
added a commit
that referenced
this pull request
Dec 10, 2024
Merged
piaskowyk
added a commit
that referenced
this pull request
Dec 10, 2024
tjzel
pushed a commit
that referenced
this pull request
Dec 13, 2024
## Summary This PR addresses the issue reported at [https://github.com/software-mansion/react-native-reanimated/issues/6719](https://github.com/software-mansion/react-native-reanimated/issues/6719) and aims to: - **Unify the method used to obtain the view tag**, as there are currently several approaches. - **Avoid passing a class component to the findNodeHandler**. Instead, we'll pass a ref to the component, similar to what Expo implemented here: [https://github.com/expo/expo/pull/33016](https://github.com/expo/expo/pull/33016). - **Limit unnecessary invocations of findNodeHandler** to no more than one call per render. - **Remove the invocation of findHostInstance from Paper renderer** on the New Architecture. **Additional Remarks:** - When a class component is passed to `createAnimatedComponent`, it will still fall back to the slow path where we can get a native ref. - In `NativeEventManager`, we need to call findNodeHandler again after every render to ensure that the children of `<GestureDetector />` haven't changed their native tags. - `LayoutAnimationConfig` still uses findNodeHandler. It requires a complete refactor of their functionality to eliminate its use, and I plan to handle this in another PR. - `findHostInstance_DEPRECATED` always follows the slow path even for native refs, which is why I've implemented our own version of `findHostInstance` to optimize the happy path. Fixes #6719 Related PRs: - #6030 - #5960 - #4445 - expo/expo#33016 ## Test plan - [x] check Paper - [x] check Fabric - [x] check Web
tjzel
pushed a commit
that referenced
this pull request
Dec 13, 2024
## Summary This PR addresses the issue reported at [https://github.com/software-mansion/react-native-reanimated/issues/6719](https://github.com/software-mansion/react-native-reanimated/issues/6719) and aims to: - **Unify the method used to obtain the view tag**, as there are currently several approaches. - **Avoid passing a class component to the findNodeHandler**. Instead, we'll pass a ref to the component, similar to what Expo implemented here: [https://github.com/expo/expo/pull/33016](https://github.com/expo/expo/pull/33016). - **Limit unnecessary invocations of findNodeHandler** to no more than one call per render. - **Remove the invocation of findHostInstance from Paper renderer** on the New Architecture. **Additional Remarks:** - When a class component is passed to `createAnimatedComponent`, it will still fall back to the slow path where we can get a native ref. - In `NativeEventManager`, we need to call findNodeHandler again after every render to ensure that the children of `<GestureDetector />` haven't changed their native tags. - `LayoutAnimationConfig` still uses findNodeHandler. It requires a complete refactor of their functionality to eliminate its use, and I plan to handle this in another PR. - `findHostInstance_DEPRECATED` always follows the slow path even for native refs, which is why I've implemented our own version of `findHostInstance` to optimize the happy path. Fixes #6719 Related PRs: - #6030 - #5960 - #4445 - expo/expo#33016 ## Test plan - [x] check Paper - [x] check Fabric - [x] check Web
tjzel
pushed a commit
that referenced
this pull request
Dec 13, 2024
## Summary This PR addresses the issue reported at [https://github.com/software-mansion/react-native-reanimated/issues/6719](https://github.com/software-mansion/react-native-reanimated/issues/6719) and aims to: - **Unify the method used to obtain the view tag**, as there are currently several approaches. - **Avoid passing a class component to the findNodeHandler**. Instead, we'll pass a ref to the component, similar to what Expo implemented here: [https://github.com/expo/expo/pull/33016](https://github.com/expo/expo/pull/33016). - **Limit unnecessary invocations of findNodeHandler** to no more than one call per render. - **Remove the invocation of findHostInstance from Paper renderer** on the New Architecture. **Additional Remarks:** - When a class component is passed to `createAnimatedComponent`, it will still fall back to the slow path where we can get a native ref. - In `NativeEventManager`, we need to call findNodeHandler again after every render to ensure that the children of `<GestureDetector />` haven't changed their native tags. - `LayoutAnimationConfig` still uses findNodeHandler. It requires a complete refactor of their functionality to eliminate its use, and I plan to handle this in another PR. - `findHostInstance_DEPRECATED` always follows the slow path even for native refs, which is why I've implemented our own version of `findHostInstance` to optimize the happy path. Fixes #6719 Related PRs: - #6030 - #5960 - #4445 - expo/expo#33016 ## Test plan - [x] check Paper - [x] check Fabric - [x] check Web
Closed
8 tasks
r0h0gg6
pushed a commit
to r0h0gg6/react-native-reanimated
that referenced
this pull request
Jul 28, 2025
## Summary This PR addresses the issue reported at [https://github.com/software-mansion/react-native-reanimated/issues/6719](https://github.com/software-mansion/react-native-reanimated/issues/6719) and aims to: - **Unify the method used to obtain the view tag**, as there are currently several approaches. - **Avoid passing a class component to the findNodeHandler**. Instead, we'll pass a ref to the component, similar to what Expo implemented here: [https://github.com/expo/expo/pull/33016](https://github.com/expo/expo/pull/33016). - **Limit unnecessary invocations of findNodeHandler** to no more than one call per render. - **Remove the invocation of findHostInstance from Paper renderer** on the New Architecture. **Additional Remarks:** - When a class component is passed to `createAnimatedComponent`, it will still fall back to the slow path where we can get a native ref. - In `NativeEventManager`, we need to call findNodeHandler again after every render to ensure that the children of `<GestureDetector />` haven't changed their native tags. - `LayoutAnimationConfig` still uses findNodeHandler. It requires a complete refactor of their functionality to eliminate its use, and I plan to handle this in another PR. - `findHostInstance_DEPRECATED` always follows the slow path even for native refs, which is why I've implemented our own version of `findHostInstance` to optimize the happy path. Fixes software-mansion#6719 Related PRs: - software-mansion#6030 - software-mansion#5960 - software-mansion#4445 - expo/expo#33016 ## Test plan - [x] check Paper - [x] check Fabric - [x] check Web
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses the issue reported at #6719 and aims to:
Additional Remarks:
createAnimatedComponent, it will still fall back to the slow path where we can get a native ref.NativeEventManager, we need to call findNodeHandler again after every render to ensure that the children of<GestureDetector />haven't changed their native tags.LayoutAnimationConfigstill uses findNodeHandler. It requires a complete refactor of their functionality to eliminate its use, and I plan to handle this in another PR.findHostInstance_DEPRECATEDalways follows the slow path even for native refs, which is why I've implemented our own version offindHostInstanceto optimize the happy path.Fixes #6719
Related PRs:
Test plan